﻿<!--
    Copyright file="UCChartCurveGraph.xaml">
    Copyright © 2009 Thuyen Tran. All Right Reserved
    Author: Thuyen Tran
    Email: trancamthuyen@yahoo.com
    Date: 12 Aug 2009
-->
    
<Grid x:Class="SimpleWPFChart.UCChartCurveGraph"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Loaded="UserControl_Loaded" 
    x:Name="gridUC" Background="Transparent"
>
    <Grid.Resources>
        <!-- for polyline curve-->
        <!--<Style TargetType="{x:Type Polyline}">
            <Setter Property="StrokeThickness" Value="1" />
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="true">
                    <Setter Property="StrokeThickness" Value="5" />
                </Trigger>
            </Style.Triggers>
        </Style>-->
        <!-- for Bezier curve -->
        <Style x:Key="pathStyleKey" x:Name="pathStyleName" TargetType="{x:Type Path}">
            <Setter Property="StrokeThickness" Value="2" />
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="true">
                    <Setter Property="StrokeThickness" Value="3" />
                </Trigger>
            </Style.Triggers>
        </Style>
    </Grid.Resources>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="Auto" />
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>

    <Border x:Name="borderUC" CornerRadius="5" BorderThickness="4" Background="Transparent" BorderBrush="Gray" Grid.Column="0" Grid.Row="0"  />
    
    <StackPanel Orientation="Vertical">
        <Label x:Name="labelTitle" FontSize="20" FontWeight="Bold" HorizontalAlignment="Center" Margin="0,10,0,5">Your Graph Title Here</Label>
        <Grid Background="Transparent">
            <Border x:Name="borderFrame" Background="CornflowerBlue" CornerRadius="5" Margin="10,10,10,10" Padding="5" >
                <Grid ShowGridLines="False" Background="Transparent" HorizontalAlignment="Center" VerticalAlignment="Center">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition  Width="Auto" />
                        <ColumnDefinition Width="Auto"   />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition Height="Auto"  />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>

                    <TextBlock x:Name="textblockYAxis" Grid.Column="0" Grid.Row="0" 
                           VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="Collapsed" 
                           Background="Transparent" Width="80" Height="30">
                        <TextBlock.RenderTransform>
                            <RotateTransform Angle="-90" CenterX="40" CenterY="15" />
                        </TextBlock.RenderTransform>
                    </TextBlock>
                    <DockPanel x:Name="dockpanelYTicks" Grid.Column="1" Grid.Row="0" Background="Transparent"  Margin="0,-5,0,-5">
                        <Label x:Name="labelMinYValue" VerticalAlignment="Bottom" HorizontalAlignment="Right" DockPanel.Dock="Bottom" Height="20" FontSize="10">minY</Label>
                        <Label x:Name="labelMaxYValue" VerticalAlignment="Top" HorizontalAlignment="Right" DockPanel.Dock="Top" Height="20" FontSize="10">maxY</Label>
                    </DockPanel>

                    <!--<Canvas x:Name="borderChart" MinWidth="400" MinHeight="100" Opacity="1" Grid.Column="2" Grid.Row="0" ClipToBounds="True">
                        <Border x:Name="temp" Grid.Column="2" Grid.Row="0" BorderBrush="Gray" Background="Transparent" BorderThickness="1,1,1,1" Padding="3"
                                MinWidth="{Binding ElementName=borderChart, Path=ActualWidth}" 
                                MinHeight="{Binding ElementName=borderChart, Path=ActualHeight}" ></Border>
                    </Canvas>-->

                    <Border BorderBrush="Gray" BorderThickness="1" Grid.Column="2" Grid.Row="0" Margin="5" > 
                        <Canvas x:Name="borderChart" MinWidth="400" MinHeight="100" Opacity="1" Grid.Column="2" Grid.Row="0" />
                    </Border>
                    
                    <DockPanel x:Name="dockpanelXTicks" Grid.Column="2" Grid.Row="1" Background="Transparent" Height="18" VerticalAlignment="Top" Margin="-4,-3,-6,0">
                        <Label x:Name="labelMinXValue" HorizontalAlignment="Left" DockPanel.Dock="Left" VerticalAlignment="Top"  Height="20" FontSize="10">minX</Label>
                        <Label x:Name="labelMaxXValue" HorizontalAlignment="Right" DockPanel.Dock="Right" VerticalAlignment="Top" FontSize="10" Height="20">maxX</Label>
                    </DockPanel>

                    <TextBlock x:Name="textblockXAxis" Grid.Column="2" Grid.Row="2" HorizontalAlignment="Center" Visibility="Collapsed" >x-axis name here</TextBlock>

                    <StackPanel x:Name="stackpanelLegendTable" Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Center" Background="LightYellow" Grid.Column="3" Grid.Row="0"  Margin="15,0,15,0">
                        <Border BorderThickness="1" BorderBrush="Gray" Padding="5,0,5,0" >
                            <StackPanel x:Name="stackpanelLegend" />                               
                        </Border>
                    </StackPanel>

                </Grid>
            </Border>
        </Grid>

    </StackPanel>

</Grid>
